Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: Use relative Jsonnet imports internally #238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maxbrunet
Copy link
Contributor

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

  • Use relative Jsonnet imports internally
  • Disable jb's legacy imports (not used, but making sure they are not accidentally used in the future)

Reasons:

  1. There is no guarantee kube-thanos/ is a valid import path for the end-user
  2. These imports were relying on jb's legacy imports which are deprecated

Verification

CI passes.

@@ -1,5 +1,5 @@
local receiveConfigDefaults = import 'kube-thanos/kube-thanos-receive-default-params.libsonnet';
local receive = import 'kube-thanos/kube-thanos-receive.libsonnet';
local receiveConfigDefaults = import './kube-thanos-receive-default-params.libsonnet';
Copy link
Collaborator

@paulfantom paulfantom Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or you can use full import path of github.com/thanos-io/kube-thanos/jsonnet/kube-thanos/kube-thanos-receive-default-params.libsonnet which is guaranteed to be correct and allows to ditch legacy imports in jsonnet-bundler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is how I use the library, but why would you do that in the library?
And it is still not guaranteed to work, for example here how it is installed in the repo itself:

{
"source": {
"local": {
"directory": "jsonnet/kube-thanos"
}
},
"version": "."
}

It create vendor/kube-thanos. It it not guarantee either that the user will use jb, especially that this library does not have any dependency. Another problematic case is if the user wants to use a fork, they need to rename those imports before being able to use it.

...and disable jb's legacy imports

Signed-off-by: Maxime Brunet <maxime.brunet@paytm.com>
@maxbrunet
Copy link
Contributor Author

maxbrunet commented Dec 16, 2021

@kakkoyun @metalmatze any concerns about merging this one if I rebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants